<html>
<head><meta charset="utf-8"><title>JSON Format · rustdoc · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/index.html">rustdoc</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html">JSON Format</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="223414744"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223414744" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223414744">(Jan 20 2021 at 18:30)</a>:</h4>
<p>Attempting to collect thoughts about JSON format improvements. List below is a mix of things from the original review and my additions.</p>



<a name="223414757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223414757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223414757">(Jan 20 2021 at 18:30)</a>:</h4>
<ul>
<li>Distinguish between structs and unions | Given the other similarities, this may be as easy as adding a fourth option to StructType?</li>
<li>Make <code>external_crates</code> just a list, instead of a map | It already uses just increasing numeric keys, nothing is lost</li>
<li>Asked about the root field | It looks like the root field is used to indicate the ID of the root in the index, as IDs are supposed to be 'opaque'</li>
<li><code>docs</code> should maybe be optional/nullable, not <code>unwrap_or_default</code> | Distinguishes between 'empty docs' and 'no docs'</li>
<li><code>include_privates</code> may be unnecessary, whether private things are there will be obvious to the user as they passed the flag | Or see the 'private' items in the output, if passed</li>
<li><code>index</code> could also be an array | This makes access by index harder, but removes duplicated info</li>
</ul>



<a name="223414796"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223414796" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223414796">(Jan 20 2021 at 18:30)</a>:</h4>
<p>Several of these changes would be very easy to implement, but any thoughts on which would be useful, or any that opinions on have changed?</p>



<a name="223416519"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223416519" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223416519">(Jan 20 2021 at 18:44)</a>:</h4>
<blockquote>
<p>include_privates may be unnecessary, whether private things are there will be obvious to the user as they passed the flag | Or see the 'private' items in the output, if passed</p>
</blockquote>
<p>I think this should be fixed first</p>



<a name="223416560"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223416560" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223416560">(Jan 20 2021 at 18:44)</a>:</h4>
<p>other than that I don't remember exactly my comments, but this all looks vaguely in the right direction</p>



<a name="223416593"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223416593" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223416593">(Jan 20 2021 at 18:44)</a>:</h4>
<p>would be great to hear from <span class="user-mention" data-user-id="229913">@HeroicKatora</span> when they get back from lunch :)</p>



<a name="223421637"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223421637" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223421637">(Jan 20 2021 at 19:20)</a>:</h4>
<ul>
<li>In <code>external_crate</code> I had missed the extra metadata that one would get from inspecting <code>cargo metadata</code>, such as versions, if that is possible. At least that would have made it a bit easier to provide a semantically meaningful list for offline documents such as pdf.</li>
<li>Fully agree on the docs nullability.</li>
<li>I'd like to make use of <code>include_privates</code> to generate a warning, indicating that the output is for development and not use. It might be obvious to the author but not any reader. I could probably also filter the items looking for any with non-public visibility.</li>
<li><code>index</code> being an array would make it easier to iterate. Currently, I basically clone that map and pop the entries one-by-one since I can't borrow the map during iteration.</li>
</ul>



<a name="223422116"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223422116" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223422116">(Jan 20 2021 at 19:24)</a>:</h4>
<p>In particular, since <code>index</code> and <code>paths</code> are not meant to be mutable, I have a very slight preference for a sorted array of sorts. But it's not a critical requirement by any means and a map is cleaner in the serde interaction/type interface.</p>



<a name="223430005"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223430005" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223430005">(Jan 20 2021 at 20:24)</a>:</h4>
<p>So, given Heroic's comment, I'd leave include_privates alone for the moment, but doc nullability should be easy long-hanging fruit, as it's just threading Option and removing some unwraps mostly</p>



<a name="223435795"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223435795" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223435795">(Jan 20 2021 at 21:09)</a>:</h4>
<p>Interesting how <code>clean::Union</code> has a StructType, as both Unit and Tuple unions are rejected by the parser (<code>expected `where` or `{` after union name, found `;` </code>)</p>



<a name="223435927"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223435927" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223435927">(Jan 20 2021 at 21:10)</a>:</h4>
<p>clean::Union and clean::Struct are the same, aside from their name. It would almost make more sense to consider 'Union' a StructType</p>



<a name="223437020"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223437020" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223437020">(Jan 20 2021 at 21:19)</a>:</h4>
<p>On the other hand, it makes sense to keep unions as distinct items. I'm thinking about this because I really want to fix the whole 'structs and unions are indistinguishable in JSON' thing</p>



<a name="223437261"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223437261" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223437261">(Jan 20 2021 at 21:20)</a>:</h4>
<p>could you make them different but leave out <code>StructType</code> from union?</p>



<a name="223437729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223437729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223437729">(Jan 20 2021 at 21:25)</a>:</h4>
<p>Yeah, that works. Mind if I do that as part of a general move of StructType into <code>clean</code>, as that's now the only place with types that store it (rendering uses it)?</p>



<a name="223437791"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223437791" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223437791">(Jan 20 2021 at 21:25)</a>:</h4>
<p>sure, SGTM</p>



<a name="223441071"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223441071" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223441071">(Jan 20 2021 at 21:52)</a>:</h4>
<p>PR for that up. I hope you don't mind that I keep requesting your review, I can let high-five pick if you'd rather not get the pings</p>



<a name="223441136"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223441136" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223441136">(Jan 20 2021 at 21:52)</a>:</h4>
<p>haha, nah this is fine</p>



<a name="223441167"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223441167" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223441167">(Jan 20 2021 at 21:52)</a>:</h4>
<p>JSON PRs are easy to review because I don't have to worry about breaking things <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span></p>



<a name="223441210"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223441210" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223441210">(Jan 20 2021 at 21:53)</a>:</h4>
<p>if something goes wrong <span class="user-mention silent" data-user-id="229913">HeroicKatora</span> can just ping me lol</p>



<a name="223441945"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223441945" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223441945">(Jan 20 2021 at 21:58)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/pull/81227/files#r561334410">https://github.com/rust-lang/rust/pull/81227/files#r561334410</a></p>



<a name="223685843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223685843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223685843">(Jan 22 2021 at 19:18)</a>:</h4>
<p>I like the idea of the json types being published as their own crate. Personally, I don't even think the rest of it is necessary (Or as reasonable, EG the conversion needs rustc internals), but the types with their serde impls is great.</p>



<a name="223687363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223687363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223687363">(Jan 22 2021 at 19:30)</a>:</h4>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span> who would I talk to about autopublishing <code>src/librustdoc/json/types.rs</code> as a crate? Is that something that makes sense to do? Happy to do the work for it.</p>



<a name="223688067"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223688067" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223688067">(Jan 22 2021 at 19:35)</a>:</h4>
<p>I would prefer to not do that personally</p>



<a name="223688101"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223688101" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223688101">(Jan 22 2021 at 19:35)</a>:</h4>
<p>what is your use case I guess?</p>



<a name="223688142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223688142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223688142">(Jan 22 2021 at 19:35)</a>:</h4>
<p>the use case is someone who wants to use the JSON API without rewriting the deserialization</p>



<a name="223688191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223688191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223688191">(Jan 22 2021 at 19:36)</a>:</h4>
<p>if we don't publish this <em>someone</em> will, and it won't be as accurate or up to date</p>



<a name="223688256"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223688256" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223688256">(Jan 22 2021 at 19:36)</a>:</h4>
<p>case in point: <a href="https://docs.rs/rustdoc-types/">https://docs.rs/rustdoc-types/</a></p>



<a name="223688269"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223688269" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223688269">(Jan 22 2021 at 19:36)</a>:</h4>
<p>then, autopublishing seems like the wrong approach to me</p>



<a name="223688297"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223688297" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223688297">(Jan 22 2021 at 19:36)</a>:</h4>
<p>what would you suggest instead?</p>



<a name="223688309"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223688309" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223688309">(Jan 22 2021 at 19:36)</a>:</h4>
<p>well, I guess, what kind of stability guarantees are we offering here?</p>



<a name="223688331"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223688331" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223688331">(Jan 22 2021 at 19:37)</a>:</h4>
<p>not tied to releases, just a normal crate with semver</p>



<a name="223688365"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223688365" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223688365">(Jan 22 2021 at 19:37)</a>:</h4>
<p>and we can document which version of the crate correponds to a Rust release</p>



<a name="223688419"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223688419" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223688419">(Jan 22 2021 at 19:37)</a>:</h4>
<p>but you want nice semver? i.e. you expect to bump major versions rarely?</p>



<a name="223688450"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223688450" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223688450">(Jan 22 2021 at 19:38)</a>:</h4>
<p>that's what I was imagining, yes</p>



<a name="223688489"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223688489" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223688489">(Jan 22 2021 at 19:38)</a>:</h4>
<p>there's more discussion in the RFC, one sec</p>



<a name="223688525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223688525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223688525">(Jan 22 2021 at 19:38)</a>:</h4>
<p><a href="https://github.com/rust-lang/rfcs/pull/2963#issuecomment-667342922">https://github.com/rust-lang/rfcs/pull/2963#issuecomment-667342922</a>, <a href="https://github.com/rust-lang/rfcs/pull/2963#issuecomment-669466678">https://github.com/rust-lang/rfcs/pull/2963#issuecomment-669466678</a></p>



<a name="223688809"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223688809" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223688809">(Jan 22 2021 at 19:40)</a>:</h4>
<p>ok. so what I would do, I think, is move that file to a separate crate, and put it under, say, rust-lang/rustdoc-json github or something like that.</p>



<a name="223688841"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223688841" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223688841">(Jan 22 2021 at 19:41)</a>:</h4>
<p>then we can publish that to <a href="http://crates.io">crates.io</a> and use it from rustdoc via normal cargo.toml dep.</p>



<a name="223688902"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223688902" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223688902">(Jan 22 2021 at 19:41)</a>:</h4>
<p>that said, I would personally prefer that we hold off on doing so until JSON in rustdoc moves out of erfc phase</p>



<a name="223688915"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223688915" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223688915">(Jan 22 2021 at 19:41)</a>:</h4>
<p>hmm, I see - the idea is that the <em>conversions</em> might break based on changes to rustc, but changing the <em>types</em> should be an intentional semver break</p>



<a name="223688935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223688935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223688935">(Jan 22 2021 at 19:41)</a>:</h4>
<p>Just to double check, would that trigger foreign impl rules on <code>impl From&lt;clean::Module&gt; for /* rustdoc_json:: */ Module</code>?</p>



<a name="223689003"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223689003" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223689003">(Jan 22 2021 at 19:42)</a>:</h4>
<p><span class="user-mention silent" data-user-id="319144">CraftSpider</span> <a href="#narrow/stream/266220-rustdoc/topic/JSON.20Format/near/223688935">said</a>:</p>
<blockquote>
<p>Just to double check, would that trigger foreign impl rules on <code>impl From&lt;clean::Module&gt; for /* rustdoc_json:: */ Module</code>?</p>
</blockquote>
<p>we can change it to free functions if need be, I'm not worried about that</p>



<a name="223689023"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223689023" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223689023">(Jan 22 2021 at 19:42)</a>:</h4>
<p>rustdoc_json shouldn't depend on librustdoc anyway</p>



<a name="223689077"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223689077" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223689077">(Jan 22 2021 at 19:42)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116122">simulacrum</span> <a href="#narrow/stream/266220-rustdoc/topic/JSON.20Format/near/223688902">said</a>:</p>
<blockquote>
<p>that said, I would personally prefer that we hold off on doing so until JSON in rustdoc moves out of erfc phase</p>
</blockquote>
<p>I think it would be nice to have it as a separate crate (but not published to <a href="http://crates.io">crates.io</a>) in-tree during the eRFC</p>



<a name="223689087"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223689087" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223689087">(Jan 22 2021 at 19:43)</a>:</h4>
<p>Makes sense, I was worried about conversion difficulty, but thinking about it more changing to free functions is basically a renaming thing</p>



<a name="223689093"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223689093" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223689093">(Jan 22 2021 at 19:43)</a>:</h4>
<p>and people can use a git dependency</p>



<a name="223689114"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223689114" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223689114">(Jan 22 2021 at 19:43)</a>:</h4>
<p>ok, well, that's not hard and doesn't require any checkin with anyone :)</p>



<a name="223689168"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223689168" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223689168">(Jan 22 2021 at 19:43)</a>:</h4>
<p>haha, I'll start with that then</p>



<a name="223689177"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223689177" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223689177">(Jan 22 2021 at 19:43)</a>:</h4>
<p>if we want a crate on <a href="http://crates.io">crates.io</a> that we expect sort of "end users" to use, then I would like to see that go through an RFC.</p>



<a name="223689178"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223689178" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223689178">(Jan 22 2021 at 19:43)</a>:</h4>
<p>hey <span class="user-mention" data-user-id="319144">@CraftSpider</span> ;)</p>



<a name="223689290"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223689290" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223689290">(Jan 22 2021 at 19:44)</a>:</h4>
<p>(likely with T-core approval as a public facing artifact, in some sense)</p>



<a name="223689470"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223689470" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223689470">(Jan 22 2021 at 19:45)</a>:</h4>
<p>Oh my. Well, I can take a look :P</p>



<a name="223689593"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223689593" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223689593">(Jan 22 2021 at 19:46)</a>:</h4>
<p>FWIW I would expect actually adding the new crate to be easy and the "hard" part to be rewriting things as free functions</p>



<a name="223689613"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223689613" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223689613">(Jan 22 2021 at 19:46)</a>:</h4>
<p>but it's hard as in a lot of time, not as in difficult</p>



<a name="223689754"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223689754" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223689754">(Jan 22 2021 at 19:47)</a>:</h4>
<p>Yeah. Where would the new crate go, just in <code>src</code>? As it's not really a 'tool'</p>



<a name="223689879"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223689879" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223689879">(Jan 22 2021 at 19:48)</a>:</h4>
<p>I would put it in <code>src/librustdoc/json-types</code> maybe</p>



<a name="223689886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223689886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223689886">(Jan 22 2021 at 19:48)</a>:</h4>
<p>definitely in librustdoc somewhere</p>



<a name="223690001"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223690001" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223690001">(Jan 22 2021 at 19:49)</a>:</h4>
<p>Yeah, that makes sense, assuming Cargo doesn't get mad because it's the same level as the <code>lib.rs</code> file? It wouldn't be a mod so I don't think so</p>



<a name="223690034"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223690034" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223690034">(Jan 22 2021 at 19:49)</a>:</h4>
<p>nah the module tree is independent of the file tree</p>



<a name="223690219"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223690219" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223690219">(Jan 22 2021 at 19:51)</a>:</h4>
<p>Cool. I have managed to hit that point where like, I know a lot about some weird things, yet fairly little about other things. Yay self-teaching and diving into things head-first :P</p>



<a name="223690999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223690999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223690999">(Jan 22 2021 at 19:57)</a>:</h4>
<p>Hm. If we want to keep this untied to rustc, should I remove the <code>FxHashMap</code> usage?</p>



<a name="223691028"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223691028" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223691028">(Jan 22 2021 at 19:57)</a>:</h4>
<p>Replace it with just the <code>std::collections::HashMap</code></p>



<a name="223691055"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223691055" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223691055">(Jan 22 2021 at 19:57)</a>:</h4>
<p>yes, please do</p>



<a name="223691143"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223691143" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223691143">(Jan 22 2021 at 19:58)</a>:</h4>
<p>you're just splitting out <code>types.rs</code>, right? <code>conversions.rs</code> needs to stay in rustdoc</p>



<a name="223691158"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223691158" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223691158">(Jan 22 2021 at 19:58)</a>:</h4>
<p>Yeah</p>



<a name="223691980"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223691980" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223691980">(Jan 22 2021 at 20:04)</a>:</h4>
<p>The types use FxHashMap in... 4 places</p>



<a name="223692051"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223692051" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223692051">(Jan 22 2021 at 20:04)</a>:</h4>
<p>And at least 2 of those have been proposed to change to a Vec, so that number might go down in the future</p>



<a name="223744362"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223744362" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223744362">(Jan 23 2021 at 11:12)</a>:</h4>
<p>Admittedly I had just copied the types over as well, changing FxHashMap to std:: in the process.</p>



<a name="223744594"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223744594" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223744594">(Jan 23 2021 at 11:18)</a>:</h4>
<p>Generally, we tend to use <code>FxHashMap</code> in the compiler, so why making the switch?</p>



<a name="223744667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223744667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223744667">(Jan 23 2021 at 11:20)</a>:</h4>
<p>When publishing as a crate, I also wouldn't have changed it. It was just slightly more consistent with the local code that I already had and didn't take an extra dependency. It wouldn't really matter for consumption.</p>



<a name="223745600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223745600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223745600">(Jan 23 2021 at 11:46)</a>:</h4>
<p>One more thing to consider for a crate would be adding non_exhaustive attributes although that comes very close to sort-of stabilizing Rust syntax, which was the argument against including syn in std for proc-macors.</p>



<a name="223773364"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223773364" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223773364">(Jan 23 2021 at 20:21)</a>:</h4>
<p>That would mean to convert between the two types... Instead of exposing <code>FxHashMap</code>, can't we expose a trait (or multiple ones) that both <code>HashMap</code> and <code>FxHashMap</code> have so we can manipulate them both without caring about the actual type?</p>



<a name="223773409"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223773409" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223773409">(Jan 23 2021 at 20:22)</a>:</h4>
<p>what would be the point of doing that?</p>



<a name="223773418"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223773418" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223773418">(Jan 23 2021 at 20:22)</a>:</h4>
<p>HashMap is not particularly complicated</p>



<a name="223773443"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223773443" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223773443">(Jan 23 2021 at 20:23)</a>:</h4>
<p><code>FxHashMap</code> is a <code>HashMap</code> IIRC</p>



<a name="223773462"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223773462" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223773462">(Jan 23 2021 at 20:23)</a>:</h4>
<p>It's just a type alias with a different hasher than the default</p>



<a name="223773490"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223773490" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223773490">(Jan 23 2021 at 20:24)</a>:</h4>
<p>See <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_data_structures/fx/type.FxHashMap.html">the docs</a></p>



<a name="223773701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223773701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223773701">(Jan 23 2021 at 20:29)</a>:</h4>
<p>Wait how does that work?</p>



<a name="223773717"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223773717" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223773717">(Jan 23 2021 at 20:29)</a>:</h4>
<p>Oh the usual HashMap methods are defined only for <code>S = RandomState</code></p>



<a name="223773768"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223773768" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223773768">(Jan 23 2021 at 20:30)</a>:</h4>
<p>Nevermind me then :p</p>



<a name="223786411"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223786411" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223786411">(Jan 24 2021 at 00:24)</a>:</h4>
<p>There was a concern marked on the PR about the new crate going in <code>src/etc</code>. So, should it be moved to <code>src/rustdoc-json-types</code> (Mark Simulacrum's suggestion), or is there some other place to put it?</p>



<a name="223786899"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223786899" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223786899">(Jan 24 2021 at 00:38)</a>:</h4>
<p>New issue, raised by <span class="user-mention silent" data-user-id="229913">HeroicKatora</span>: the <code>Method</code> kind does not possess an ABI field, but (trait) methods may have an ABI</p>



<a name="223786994"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223786994" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223786994">(Jan 24 2021 at 00:41)</a>:</h4>
<p>Add <code>is_unsafe</code> to the list missing from <code>Function</code> and <code>Method</code> as well. It's present on <code>FunctionPointer</code>.</p>



<a name="223787012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223787012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223787012">(Jan 24 2021 at 00:41)</a>:</h4>
<p>Currently, <code>unsafe</code> should appear as part of the <code>header</code> field. If it doesn't, that's a bug</p>



<a name="223787072"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223787072" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223787072">(Jan 24 2021 at 00:42)</a>:</h4>
<p>fn pointers are handled differently, I suspect because they currently cannot be <code>async</code> or <code>const</code>, the other things that appear in <code>header</code></p>



<a name="223787082"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223787082" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223787082">(Jan 24 2021 at 00:43)</a>:</h4>
<p>I see! That's fine then, unless it makes recombining the declaration harder.</p>



<a name="223787249"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223787249" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223787249">(Jan 24 2021 at 00:47)</a>:</h4>
<p>I'd think it would be fine. Max forward-compat would actually make function pointers drop <code>is_unsafe</code> and use <code>header</code>, so that if say <code>const</code> fn pointers ever come to be then it can be non-breaking to add them (assuming we mark that adding new values to header might happen at will)</p>



<a name="223813946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223813946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223813946">(Jan 24 2021 at 13:26)</a>:</h4>
<p><span class="user-mention silent" data-user-id="319144">CraftSpider</span> <a href="#narrow/stream/266220-rustdoc/topic/JSON.20Format/near/223786411">said</a>:</p>
<blockquote>
<p>There was a concern marked on the PR about the new crate going in <code>src/etc</code>. So, should it be moved to <code>src/rustdoc-json-types</code> (Mark Simulacrum's suggestion), or is there some other place to put it?</p>
</blockquote>
<p><span class="user-mention" data-user-id="319144">@CraftSpider</span>  yes, <code>rustdoc-json-types</code> is fine. Next time can you please ask this on the PR? I had trouble finding your comment and I wasn't sure why you didn't make the change in the PR, I almost marked it waiting-on-author.</p>



<a name="223842929"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/223842929" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#223842929">(Jan 24 2021 at 23:44)</a>:</h4>
<p>Current format changes I have in mind:</p>
<ul>
<li>Remove <code>struct_type</code> from <code>union</code></li>
<li>Add <code>abi</code> to <code>method</code></li>
<li>Change <code>header</code> to a <code>Vec&lt;String&gt;</code>, or even a <code>Vec&lt;Modifier&gt;</code> (name of new enum open to bikeshed). Replace <code>is_unsafe</code> on fn pointer with <code>header: Vec&lt;Modifier&gt;</code> for future-compat with const fn pointers</li>
</ul>



<a name="224558175"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/224558175" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#224558175">(Jan 30 2021 at 01:31)</a>:</h4>
<p>Another thing I just noticed, Import calls the full path 'span', I feel there could be a better name?</p>



<a name="224563953"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/JSON%20Format/near/224563953" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/JSON.20Format.html#224563953">(Jan 30 2021 at 04:01)</a>:</h4>
<p>What about <code>path</code> <span aria-label="upside down" class="emoji emoji-1f643" role="img" title="upside down">:upside_down:</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>